#include <glib.h>

static void test_thread_pool_func(gpointer data, gpointer user_data)
{
    g_print("get data: %d \n", GPOINTER_TO_INT(data));
}

void test_thread_pool_push(void)
{
    GThreadPool *pool = NULL;
    GError *error = NULL;
    gint max_threads = 4;

    pool = g_thread_pool_new(test_thread_pool_func, NULL, max_threads, FALSE, &error);

    g_thread_pool_push(pool, GINT_TO_POINTER(99), &error);
    g_usleep(100*1000);

    g_thread_pool_free(pool, TRUE, TRUE);
}

gint main(gint argc, gchar **argv)
{
    test_thread_pool_push();
}